package com.algorithms.techniques;

import java.util.Set;
//@SuppressWarnings("hiding")
public abstract class CopyOfGreedyAlgorithm<I>
{
	 protected abstract <I> boolean checkAndSetCondition(Set<I> inputStructure);
	 
	 protected abstract <I> Set<I> reorderInput(Set<I> inputStructure);
	 
	 protected abstract <I> I makeAGreedyChoice(Set<I> inputStructure);
	 
	 protected abstract <I> void  addToGreedyOutput(I choice,Set<I> outputStructure );
	 
	 protected abstract  <I> Set<I>  removeChoiceFromInput(Set<I> inputStructure);
	 
     public void solveGreedily(Set<I> inputStructure,Set<I> outputStructure)
     {
    	 if(checkAndSetCondition(inputStructure))
    		 return ;
		 inputStructure= reorderInput(inputStructure);
		 
		 I choice = makeAGreedyChoice(inputStructure);
		 
		 addToGreedyOutput(choice,outputStructure);
		 
		 removeChoiceFromInput(inputStructure);
		 solveGreedily(inputStructure,outputStructure);
    	
     }

	
    
     
}
